package com.iyao_app.adapter;

import android.support.annotation.Nullable;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.iyao_app.R;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import de.hdodenhof.circleimageview.CircleImageView;

/**
 * 作者 :  胡家兵
 * 时间 :  2017/12/15.
 */

public class MessageAdapter extends BaseQuickAdapter<String, BaseViewHolder> {
    private static TranslateAnimation inAnim;//礼物View出现的动画
    private static TranslateAnimation outAnim;//礼物View消失的动画

    public MessageAdapter(@Nullable List<String> data) {
        super(R.layout.item_message, data);

        inAnim = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 1, Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 1, Animation.RELATIVE_TO_SELF, 1);
        inAnim.setDuration(2000);
        outAnim = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, -1, Animation.RELATIVE_TO_SELF, 1, Animation.RELATIVE_TO_SELF, 1);
        outAnim.setDuration(2000);
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {

    }

    static class ViewHolder extends BaseViewHolder {
        @BindView(R.id.cover_head)
        CircleImageView mCoverHead;
        @BindView(R.id.tv_name)
        TextView mTvName;
        @BindView(R.id.tv_location)
        TextView mTvLocation;
        @BindView(R.id.tv_time)
        TextView mTvTime;
        @BindView(R.id.lin_root)
        LinearLayout mLinRoot;

        ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }
    }
}
